import React from 'react';
import { PlusCircleFilled, EditOutlined, DeleteFilled } from '@ant-design/icons';
import './index.less';
import PermissionButton from '@/component/permission-button';

const Groups: React.FC<any> = props => {
  return (
    <>
      {props.text}
      <div className="tree_item_tools">
        <PermissionButton permission="add">
          {props.hasAdd ? <PlusCircleFilled onClick={props.onAdd} /> : ''}
        </PermissionButton>
        <PermissionButton permission="edit">
          <EditOutlined onClick={props.onEdit} />
        </PermissionButton>
        <PermissionButton permission="delete">
          <DeleteFilled onClick={props.onDel} />
        </PermissionButton>
      </div>
    </>
  );
};

export default Groups;
